\(\int \frac {\tan (x)}{a+a \cos (x)} \, dx\) [4]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 11, antiderivative size = 18 \[ \int \frac {\tan (x)}{a+a \cos (x)} \, dx=-\frac {\log (\cos (x))}{a}+\frac {\log (1+\cos (x))}{a} \]

[Out]

-ln(cos(x))/a+ln(1+cos(x))/a

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {2786, 36, 29, 31} \[ \int \frac {\tan (x)}{a+a \cos (x)} \, dx=\frac {\log (\cos (x)+1)}{a}-\frac {\log (\cos (x))}{a} \]

[In]

Int[Tan[x]/(a + a*Cos[x]),x]

[Out]

-(Log[Cos[x]]/a) + Log[1 + Cos[x]]/a

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 2786

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[x^p*((a + x)^(m - (p + 1)/2)/(a - x)^((p + 1)/2)), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& EqQ[a^2 - b^2, 0] && IntegerQ[(p + 1)/2]

Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {1}{x (a+x)} \, dx,x,a \cos (x)\right ) \\ & = -\frac {\text {Subst}\left (\int \frac {1}{x} \, dx,x,a \cos (x)\right )}{a}+\frac {\text {Subst}\left (\int \frac {1}{a+x} \, dx,x,a \cos (x)\right )}{a} \\ & = -\frac {\log (\cos (x))}{a}+\frac {\log (1+\cos (x))}{a} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.67 \[ \int \frac {\tan (x)}{a+a \cos (x)} \, dx=\frac {2 \text {arctanh}(1+2 \cos (x))}{a} \]

[In]

Integrate[Tan[x]/(a + a*Cos[x]),x]

[Out]

(2*ArcTanh[1 + 2*Cos[x]])/a

Maple [A] (verified)

Time = 0.61 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.89

method result size
default \(\frac {\ln \left (\cos \left (x \right )+1\right )-\ln \left (\cos \left (x \right )\right )}{a}\) \(16\)
risch \(\frac {2 \ln \left ({\mathrm e}^{i x}+1\right )}{a}-\frac {\ln \left ({\mathrm e}^{2 i x}+1\right )}{a}\) \(28\)

[In]

int(tan(x)/(a+cos(x)*a),x,method=_RETURNVERBOSE)

[Out]

1/a*(ln(cos(x)+1)-ln(cos(x)))

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.11 \[ \int \frac {\tan (x)}{a+a \cos (x)} \, dx=-\frac {\log \left (-\cos \left (x\right )\right ) - \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right )}{a} \]

[In]

integrate(tan(x)/(a+a*cos(x)),x, algorithm="fricas")

[Out]

-(log(-cos(x)) - log(1/2*cos(x) + 1/2))/a

Sympy [F]

\[ \int \frac {\tan (x)}{a+a \cos (x)} \, dx=\frac {\int \frac {\tan {\left (x \right )}}{\cos {\left (x \right )} + 1}\, dx}{a} \]

[In]

integrate(tan(x)/(a+a*cos(x)),x)

[Out]

Integral(tan(x)/(cos(x) + 1), x)/a

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.00 \[ \int \frac {\tan (x)}{a+a \cos (x)} \, dx=\frac {\log \left (\cos \left (x\right ) + 1\right )}{a} - \frac {\log \left (\cos \left (x\right )\right )}{a} \]

[In]

integrate(tan(x)/(a+a*cos(x)),x, algorithm="maxima")

[Out]

log(cos(x) + 1)/a - log(cos(x))/a

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.06 \[ \int \frac {\tan (x)}{a+a \cos (x)} \, dx=\frac {\log \left (\cos \left (x\right ) + 1\right )}{a} - \frac {\log \left ({\left | \cos \left (x\right ) \right |}\right )}{a} \]

[In]

integrate(tan(x)/(a+a*cos(x)),x, algorithm="giac")

[Out]

log(cos(x) + 1)/a - log(abs(cos(x)))/a

Mupad [B] (verification not implemented)

Time = 13.73 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.78 \[ \int \frac {\tan (x)}{a+a \cos (x)} \, dx=-\frac {\ln \left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2-1\right )}{a} \]

[In]

int(tan(x)/(a + a*cos(x)),x)

[Out]

-log(tan(x/2)^2 - 1)/a